package controlador;

import com.example.piedrapapeltijeralagartospok.P1_Activity;
import com.example.piedrapapeltijeralagartospok.R;

import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;

public class Listener_P1 implements OnClickListener {
	private P1_Activity a;


	public Listener_P1(P1_Activity a) {
		this.a = a;
		
	}

	@Override
	public void onClick(View v) {
		Intent i = new Intent(a,P1_Activity.class);
		switch (v.getId()) {

		case R.id.piedra:
			i.putExtra("seleccion",1);
			break;
		case R.id.papel:
			i.putExtra("seleccion",2);
			break;
		case R.id.tijera:
			i.putExtra("seleccion",3);
			break;
		case R.id.lagarto:
			i.putExtra("seleccion",4);
			break;
		case R.id.spok:
			i.putExtra("seleccion",5);
			break;
			
		}
		
		a.setResult(Activity.RESULT_OK,i);
		a.finish();
	}
}
